<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
	<meta charset="utf-8" />
	<title>湖南涉外经济学院论坛</title>
	<style type="text/css">

.post_body {
    font-size: 14px;
    min-height: 170px;
    overflow: hidden;
    padding: 10px;
    word-wrap: break-word;
}
body { 
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #4f6b72; 
background: #E6EAE9; 
} 

a { 
color: #c75f3e; 
} 

.mytable { 
width: 100%; 
padding: 0px; 
margin: 0px; 
} 

caption { 
padding: 0 0 5px 0; 
width: 700px; 
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
text-align: right; 
} 


td { 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
background: #fff; 
font-size:11px; 
padding: 6px 6px 6px 12px; 
color: #4f6b72; 
} 


td.alt { 
background: #F5FAFA; 
color: #797268; 
} 

th.spec { 
border-left: 1px solid #C1DAD7; 
border-top: 0; 
background: #fff no-repeat; 
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
} 

th.specalt { 
border-left: 1px solid #C1DAD7; 
border-top: 0; 
background: #f5fafa no-repeat; 
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #797268; 
} 
/*---------for IE 5.x bug*/ 
html>body td{ font-size:11px;} 
body,td,th { 
font-family: 宋体, Arial; 
font-size: 12px; 
} 
</style>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script src="js/client_validate.js"></script>
<script type="text/javascript">
	function loginUserInfo(){
	
		var loginuserinfo=document.getElementById("loginuser_email1");
			if(trim(loginuserinfo.value)==""){
				alert("账号不能为空");
				return  ;
			}
			var password=document.getElementById("loginuser_password1");
			if(trim(password.value)==""){
				alert("密码不能为空");
				return ;
			}	
			
		 $.ajax({
				type: "POST",
				url: "bbsUserInfo_checkLogin.do",
				dateType: "html",
				data: {'bbsUserInfo.email': $("#loginuser_email1").val(),
						'bbsUserInfo.password': $("#loginuser_password1").val()},
				success: function(returnedData){
					if(returnedData=="this"){
						alert("用户名或密码不正确，请重新输入");
					}else{
						$("#login1").submit();
					}
					
				}
			});
	}
	function checkUser(){
	
			$.ajax({
				type: "POST",
				url: "bbsUserInfo_isLogin.do",
				dateType: "html",
				success: function(returnedData){
					if(returnedData=="null"){
						alert("没有登录，不能发帖，请登录系统！");
					}else{
						$("#bbsTitleInfo_addShow").submit();
					}
				}
				
			});
	}
</script>

</head>
<body>
	 <div id="head" style="width: 100%;color: blue;height: 10%"><span style="float: left;">湖南涉外经济学院论坛>></span>
	 				<form action="" id="addTitleInfoShow">
	 					<span style="float: right;"><input type="button" value="发帖"></span>
	 				</form>
	 				<form action="" id="loginUserInfo">
	 					<c:if test="${sessionScope.bbsUserInfo==null}">
	 					<span style="float: right;"><a href="register.jsp">&nbsp注册&nbsp</a></span>
	 					<span style="float: right;"><a href="#" onclick="loginUserInfo()">&nbsp登陆&nbsp|</a></span>
    					<span style="float: right;"><table>
    							<tr>
    								<td>用户名：</td>
    								<td><input type="text" name="bbsUserInfo.email" id=loginuser_email1 size="30px"></td>
    							</tr>
    							<tr>
    								<td>密码：</td>
    								<td><input type="text" name="bbsUserInfo.email" id=loginuser_email1 size="30px"></td>
    							</tr>
    					</table>
    					</span>
    					</c:if>
    					
    					<c:if test="${sessionScope.bbsUserInfo!=null}">
    						<c:if test="${sessionScope.bbsUserInfo.userLevel==5}">
    								<span style="float: right;"><a href="href="../bbs/main.jsp"">|&nbsp后台管理&nbsp</a></span>
							</c:if>
    						<span style="float: right;"><a href="bbsUserInfo_logout.do"">&nbsp注销&nbsp</a></span>
    						<span style="float: right;"><a href="#">&nbsp${sessionScope.bbsUserInfo.username }&nbsp|</a></span>
    					</c:if>
    				</form>
    					</div>
    <br>
   
  <div style="">
   <hr style="height:10px;border:none;border-top:10px groove skyblue;">
  	<table id="mytable" cellspacing="0" class="mytable">
  		<tr  class="row">
  			<td rowspan="3" width="20%">${bbsTitleInfo.titleUsername}</td>
  			<td>
  				<div style="color: blue;float: left;">${bbsTitleInfo.titleCreateTime }</div>
  				<div style="color: blue;float: right;">楼主</div>
  			</td>
  		</tr>
  		<tr  class="row">
  			<td>
	  			<div class="post_body">${bbsTitleInfo.titleDetail}
	  			</div>
  			</td>
  		</tr>
  		<tr class="row">
  			<td><div style="color: green;">回复数：${bbsTitleInfo.titleReplyNum}</div></td>
  		</tr>
  	</table>
  </div>
  <hr style="height:10px;border:none;border-top:10px groove skyblue;">
  <div>
 <c:forEach items="${bbsReplyInfoList}" var="bbsReplyInfo" varStatus="replyInfo">
  	<table id="mytable" cellspacing="0" class="mytable">
  		<tr  class="row">
  			<td rowspan="3" width="20%">${bbsReplyInfo.replyUsername}</td>
  			<td>
  				<div style="color: blue;float: left;">${bbsReplyInfo.replyTime}</div>
  				<div style="color: blue;float: right;">${replyInfo.index}</div>
  			</td>
  		</tr>
  		<tr  class="row">
  			<td><div class="post_body">${bbsReplyInfo.replyDetail}</div></td>
  		</tr>
  		<tr class="row">
  			<td><div style="color: green;"></div></td>
  		</tr>
  	</table>
  </div>
  <hr style="height:10px;border:none;border-top:10px groove skyblue;">
 </c:forEach>
 <div>
 	<table class="mytable" cellspacing="0" >
 		<tr>
  	<td width="70%">
  		&nbsp&nbsp&nbsp&nbsp&nbsp 第   ${page} 页  
  	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 共  ${maxpage }页 
  	
  	</td>
  	<td colspan="2" align="center" width="20%">
  		<a href="bbsTitleInfo_showmainTitleInfo.do?page=1">首页</a>
  		<a href="bbsTitleInfo_prePage.do?page=${page}">&nbsp&nbsp&nbsp上一页</a>
  		<a href="bbsTitleInfo_nextPage.do?page=${page}">&nbsp&nbsp&nbsp下一页</a>
  		<a href="bbsTitleInfo_showmainTitleInfo.do?page=${maxpage }">&nbsp&nbsp&nbsp末页</a></td>
  	<td align="center" width="10%">转到  <input type="text" size="2px"> 页</td>
  </tr>
 	</table>
 </div>
 <div id="botton">
	
 	<form name="bbsReplyForm" method="post" action="bbsReplyInfo_addInfo.do">
 	<input type="hidden" name="bbsReplyInfo.replyTitleid" value="${bbsTitleInfo.titleId }"/>
		<textarea name="bbsReplyInfo.replyDetail" rows="12" cols="80" style="width: 80%"></textarea>
		<br />
		<input type="submit" name="button" value="提交内容"  /> 
	</form>
</div>
</body>
</html>
